<?php

namespace App\Models;

use App\Models\Traits\ScopeLikeTrait;
use App\Models\Traits\ScopeTrashedTrait;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Career extends Model
{
    use SoftDeletes;
    use ScopeLikeTrait;
    use ScopeTrashedTrait;

    public $timestamps = false;

    protected $fillable = ['title', 'description'];

    public function skills()
    {
        return $this->belongsToMany(Skill::class)->using(CareerSkill::class)->withPivot(CareerSkill::OTHER_COLUMNS);
    }

    public function users()
    {
        return $this->belongsToMany(User::class, 'user_career')->using(UserCareer::class);
    }
}
